//
//  BlackjackGameViewController.h
//  Blackjack
//
//  Created by mrbradle on 11/7/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "BlackjackGame.h"

@interface BlackjackGameViewController : UIViewController <UIAlertViewDelegate> {
    
    BlackjackGame* game;
    
    UILabel* houseLabel;
    
    UILabel* playerLabel;
    UILabel* betLabel;
    UILabel* roundLabel;
    UILabel* chipsLabel;
    
    //Views that only are active when game.status == 1
    UILabel* minBetLabel;
    UILabel* maxBetLabel;
    UILabel* currentBetLabel;
    UISlider* betSlider;
    UIButton* dealButton;
    
    //Views that are only active when game.status == 2
    UIButton* hitButton;
    UIButton* standButton;
    UIButton* doubleButton;
    UIButton* splitButton;
    UIButton* continueButton;
    UILabel* valueLabel;
    UILabel* houseValueLabel;
    
    //Image views
    NSMutableArray* deckCards;
    NSMutableArray* playerCards;
    NSMutableArray* houseCards;
    
}

- (void)initGame:(BlackjackGame*)game_;
- (void)updateView;
- (void)updatePlayerCards;
- (void)updateHouseCards;

- (void)startGame;
- (IBAction)deal;
- (IBAction)hit;
- (IBAction)stand;
- (IBAction)double_;
- (IBAction)split;
- (void)bust;
- (void)endRound;
- (IBAction)continue_;

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;

- (IBAction)currentBetChanged;

@property (nonatomic,retain) IBOutlet BlackjackGame* game;

@property (nonatomic,retain) IBOutlet UILabel* houseLabel;
@property (nonatomic,retain) IBOutlet UILabel* playerLabel;
@property (nonatomic,retain) IBOutlet UILabel* betLabel;
@property (nonatomic,retain) IBOutlet UILabel* roundLabel;
@property (nonatomic,retain) IBOutlet UILabel* chipsLabel;

@property (nonatomic,retain) IBOutlet UILabel* minBetLabel;
@property (nonatomic,retain) IBOutlet UILabel* maxBetLabel;
@property (nonatomic,retain) IBOutlet UILabel* currentBetLabel;
@property (nonatomic,retain) IBOutlet UISlider* betSlider;
@property (nonatomic,retain) IBOutlet UIButton* dealButton;

@property (nonatomic,retain) IBOutlet UIButton* hitButton;
@property (nonatomic,retain) IBOutlet UIButton* standButton;
@property (nonatomic,retain) IBOutlet UIButton* doubleButton;
@property (nonatomic,retain) IBOutlet UIButton* splitButton;
@property (nonatomic,retain) IBOutlet UIButton* continueButton;
@property (nonatomic,retain) IBOutlet UILabel* valueLabel;
@property (nonatomic,retain) IBOutlet UILabel* houseValueLabel;

@property (nonatomic,retain) IBOutlet NSMutableArray* deckCards;
@property (nonatomic,retain) IBOutlet NSMutableArray* playerCards;
@property (nonatomic,retain) IBOutlet NSMutableArray* houseCards;

@end
